//
//  JYTPopupMenu.h
//  JYT_IOS
//
//  Created by nxa-tankeke on 16/12/22.
//  Copyright © 2016年 nxa-yuanguoxiang. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger , JYTPopupMenuType) {
    YBPopupMenuTypeDefault = 0,
    YBPopupMenuTypeDark
};

@class JYTPopupMenu;
@protocol JYTPopupMenuDelegate <NSObject>

@optional
- (void)popupMenuDidSelectedAtIndex:(NSInteger)index popupMenu:(JYTPopupMenu *)popupMenu;
- (void)popupMenuBeganDismiss;
- (void)popupMenuDidDismiss;

@end

@interface JYTPopupMenu : UIView

@property (nonatomic, assign) CGFloat cornerRadius;

@property (nonatomic, assign , getter=isShadowShowing) BOOL isShowShadow;

@property (nonatomic, assign) BOOL dismissOnSelected;

@property (nonatomic, assign) BOOL dismissOnTouchOutside;

@property (nonatomic, assign) CGFloat fontSize;

@property (nonatomic, strong) UIColor * textColor;

@property (nonatomic, assign) CGFloat offset;

@property (nonatomic, assign) JYTPopupMenuType type;

@property (nonatomic, weak) id <JYTPopupMenuDelegate> delegate;


+ (instancetype)showAtPoint:(CGPoint)point
                     titles:(NSArray *)titles
                      icons:(NSArray *)icons
                  menuWidth:(CGFloat)itemWidth
                   delegate:(id<JYTPopupMenuDelegate>)delegate;


+ (instancetype)showRelyOnView:(UIView *)view
                        titles:(NSArray *)titles
                         icons:(NSArray *)icons
                     menuWidth:(CGFloat)itemWidth
                      delegate:(id<JYTPopupMenuDelegate>)delegate;


- (void)dismiss;

@end
